<extend name="Public:base" />
<block name="css">
    <link href="__CSS__/plugins/waitMe/waitMe.min.css" rel="stylesheet">
    <link href="__CSS__/plugins/toastr/toastr.min.css" rel="stylesheet"/>
</block>
<block name="js">
    <script src="__JS__/plugins/toastr/toastr.min.js"></script>
    <script type='text/javascript'>
        //搜索列表
        var search_url = "{:U('Tag/search')}";
        $("#search").click(function () {
            var params = $("#form").serialize();
            $("#refresh_box").waitMe(config.waitme);
            loadList(params);
        });
        //加载列表
        function loadList(params) {
            $.post(search_url, params, function (data) {
                if (data.status == 1) {
                    $("#refresh_box").html(data.content);
                } else {
                    toastr.error(data.info);
                }
            });
        }
        //提交表单
        $("#form").Validform(config.validform);
        //点击排序
        $("#refresh_box").on('click', ".sorting,.sorting_asc,.sorting_desc", function () {
            var params = $("#form").serializeArray();
            var sort_name = {name: 'sort_field', value: $(this).attr('data-sort-field')};
            var sort_type = {name: 'sort_type', value: $(this).attr('class')};
            params.push(sort_name);
            params.push(sort_type);
            loadList(params);
        });

    </script>
</block>
<block name="content">
    <div class="ibox float-e-margins">
        <div class="ibox-content clearfix">
            <div id='refresh_box'>
                <include file='Item/_list'/>
            </div>
        </div>
    </div>
</block>